Optimal. Leaf size=251 \[ -\frac {\tanh ^{-1}(a+b x)^2}{x}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{1-a}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1+a}-\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1-a^2}+\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}+\frac {b \text {PolyLog}\left (2,-\frac {1+a+b x}{1-a-b x}\right )}{2 (1-a)}-\frac {b \text {PolyLog}\left (2,1-\frac {2}{1+a+b x}\right )}{2 (1+a)}+\frac {b \text {PolyLog}\left (2,1-\frac {2}{1+a+b x}\right )}{1-a^2}-\frac {b \text {PolyLog}\left (2,1-\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.49, antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 15, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.250, Rules used =
{6244, 378, 720, 31, 647, 6873, 6256, 6820, 12, 6857, 6057, 2449, 2352, 2497, 6055}
\begin {gather*} \frac {b \text {Li}_2\left (1-\frac {2}{a+b x+1}\right )}{1-a^2}-\frac {b \text {Li}_2\left (1-\frac {2 b x}{(1-a) (a+b x+1)}\right )}{1-a^2}-\frac {2 b \log \left (\frac {2}{a+b x+1}\right ) \tanh ^{-1}(a+b x)}{1-a^2}+\frac {2 b \log \left (\frac {2 b x}{(1-a) (a+b x+1)}\right ) \tanh ^{-1}(a+b x)}{1-a^2}+\frac {b \text {Li}_2\left (-\frac {a+b x+1}{-a-b x+1}\right )}{2 (1-a)}-\frac {b \text {Li}_2\left (1-\frac {2}{a+b x+1}\right )}{2 (a+1)}-\frac {\tanh ^{-1}(a+b x)^2}{x}+\frac {b \log \left (\frac {2}{-a-b x+1}\right ) \tanh ^{-1}(a+b x)}{1-a}+\frac {b \log \left (\frac {2}{a+b x+1}\right ) \tanh ^{-1}(a+b x)}{a+1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 31
Rule 378
Rule 647
Rule 720
Rule 2352
Rule 2449
Rule 2497
Rule 6055
Rule 6057
Rule 6244
Rule 6256
Rule 6820
Rule 6857
Rule 6873
Rubi steps
\begin {align*} \int \frac {\tanh ^{-1}(a+b x)^2}{x^2} \, dx &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+(2 b) \int \frac {\tanh ^{-1}(a+b x)}{x \left (1-(a+b x)^2\right )} \, dx\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+(2 b) \int \frac {\tanh ^{-1}(a+b x)}{x \left (1-a^2-2 a b x-b^2 x^2\right )} \, dx\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+2 \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{\left (-\frac {a}{b}+\frac {x}{b}\right ) \left (1-x^2\right )} \, dx,x,a+b x\right )\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+2 \text {Subst}\left (\int \frac {b \tanh ^{-1}(x)}{(-a+x) \left (1-x^2\right )} \, dx,x,a+b x\right )\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+(2 b) \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{(-a+x) \left (1-x^2\right )} \, dx,x,a+b x\right )\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+(2 b) \text {Subst}\left (\int \left (\frac {\tanh ^{-1}(x)}{\left (-1+a^2\right ) (a-x)}+\frac {\tanh ^{-1}(x)}{2 (-1+a) (-1+x)}-\frac {\tanh ^{-1}(x)}{2 (1+a) (1+x)}\right ) \, dx,x,a+b x\right )\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}-\frac {b \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{-1+x} \, dx,x,a+b x\right )}{1-a}-\frac {b \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{1+x} \, dx,x,a+b x\right )}{1+a}-\frac {(2 b) \text {Subst}\left (\int \frac {\tanh ^{-1}(x)}{a-x} \, dx,x,a+b x\right )}{1-a^2}\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{1-a}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1+a}-\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1-a^2}+\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}-\frac {b \text {Subst}\left (\int \frac {\log \left (\frac {2}{1-x}\right )}{1-x^2} \, dx,x,a+b x\right )}{1-a}-\frac {b \text {Subst}\left (\int \frac {\log \left (\frac {2}{1+x}\right )}{1-x^2} \, dx,x,a+b x\right )}{1+a}+\frac {(2 b) \text {Subst}\left (\int \frac {\log \left (\frac {2}{1+x}\right )}{1-x^2} \, dx,x,a+b x\right )}{1-a^2}-\frac {(2 b) \text {Subst}\left (\int \frac {\log \left (\frac {2 (a-x)}{(-1+a) (1+x)}\right )}{1-x^2} \, dx,x,a+b x\right )}{1-a^2}\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{1-a}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1+a}-\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1-a^2}+\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}-\frac {b \text {Li}_2\left (1-\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}+\frac {b \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1-a-b x}\right )}{1-a}-\frac {b \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+a+b x}\right )}{1+a}+\frac {(2 b) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+a+b x}\right )}{1-a^2}\\ &=-\frac {\tanh ^{-1}(a+b x)^2}{x}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1-a-b x}\right )}{1-a}+\frac {b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1+a}-\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2}{1+a+b x}\right )}{1-a^2}+\frac {2 b \tanh ^{-1}(a+b x) \log \left (\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}+\frac {b \text {Li}_2\left (1-\frac {2}{1-a-b x}\right )}{2 (1-a)}-\frac {b \text {Li}_2\left (1-\frac {2}{1+a+b x}\right )}{2 (1+a)}+\frac {b \text {Li}_2\left (1-\frac {2}{1+a+b x}\right )}{1-a^2}-\frac {b \text {Li}_2\left (1-\frac {2 b x}{(1-a) (1+a+b x)}\right )}{1-a^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.02, size = 208, normalized size = 0.83 \begin {gather*} \frac {-\left (\left (-a+a^3+a^2 b x+b \left (-1+\sqrt {1-a^2} e^{\tanh ^{-1}(a)}\right ) x\right ) \tanh ^{-1}(a+b x)^2\right )+a b x \tanh ^{-1}(a+b x) \left (-i \pi +2 \tanh ^{-1}(a)-2 \log \left (1-e^{2 \tanh ^{-1}(a)-2 \tanh ^{-1}(a+b x)}\right )\right )+a b x \left (i \pi \left (\log \left (1+e^{2 \tanh ^{-1}(a+b x)}\right )-\log \left (\frac {1}{\sqrt {1-(a+b x)^2}}\right )\right )+2 \tanh ^{-1}(a) \left (\log \left (1-e^{2 \tanh ^{-1}(a)-2 \tanh ^{-1}(a+b x)}\right )-\log \left (-i \sinh \left (\tanh ^{-1}(a)-\tanh ^{-1}(a+b x)\right )\right )\right )\right )+a b x \text {PolyLog}\left (2,e^{2 \tanh ^{-1}(a)-2 \tanh ^{-1}(a+b x)}\right )}{a \left (-1+a^2\right ) x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.45, size = 356, normalized size = 1.42
method | result | size |
derivativedivides | \(b \left (-\frac {\arctanh \left (b x +a \right )^{2}}{b x}-\frac {2 \arctanh \left (b x +a \right ) \ln \left (b x +a +1\right )}{2 a +2}-\frac {2 \arctanh \left (b x +a \right ) \ln \left (-b x \right )}{\left (a -1\right ) \left (a +1\right )}+\frac {2 \arctanh \left (b x +a \right ) \ln \left (b x +a -1\right )}{2 a -2}+\frac {\ln \left (b x +a -1\right )^{2}}{4 a -4}-\frac {\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 \left (a -1\right )}-\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 \left (a -1\right )}-\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (b x +a +1\right )}{2 \left (a +1\right )}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 a +2}+\frac {\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 a +2}+\frac {\ln \left (b x +a +1\right )^{2}}{4 a +4}-\frac {\dilog \left (\frac {-b x -a +1}{-a +1}\right )}{\left (a -1\right ) \left (a +1\right )}-\frac {\ln \left (-b x \right ) \ln \left (\frac {-b x -a +1}{-a +1}\right )}{\left (a -1\right ) \left (a +1\right )}+\frac {\dilog \left (\frac {-b x -a -1}{-a -1}\right )}{\left (a -1\right ) \left (a +1\right )}+\frac {\ln \left (-b x \right ) \ln \left (\frac {-b x -a -1}{-a -1}\right )}{\left (a -1\right ) \left (a +1\right )}\right )\) | \(356\) |
default | \(b \left (-\frac {\arctanh \left (b x +a \right )^{2}}{b x}-\frac {2 \arctanh \left (b x +a \right ) \ln \left (b x +a +1\right )}{2 a +2}-\frac {2 \arctanh \left (b x +a \right ) \ln \left (-b x \right )}{\left (a -1\right ) \left (a +1\right )}+\frac {2 \arctanh \left (b x +a \right ) \ln \left (b x +a -1\right )}{2 a -2}+\frac {\ln \left (b x +a -1\right )^{2}}{4 a -4}-\frac {\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 \left (a -1\right )}-\frac {\ln \left (b x +a -1\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 \left (a -1\right )}-\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (b x +a +1\right )}{2 \left (a +1\right )}+\frac {\ln \left (-\frac {b x}{2}-\frac {a}{2}+\frac {1}{2}\right ) \ln \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 a +2}+\frac {\dilog \left (\frac {b x}{2}+\frac {a}{2}+\frac {1}{2}\right )}{2 a +2}+\frac {\ln \left (b x +a +1\right )^{2}}{4 a +4}-\frac {\dilog \left (\frac {-b x -a +1}{-a +1}\right )}{\left (a -1\right ) \left (a +1\right )}-\frac {\ln \left (-b x \right ) \ln \left (\frac {-b x -a +1}{-a +1}\right )}{\left (a -1\right ) \left (a +1\right )}+\frac {\dilog \left (\frac {-b x -a -1}{-a -1}\right )}{\left (a -1\right ) \left (a +1\right )}+\frac {\ln \left (-b x \right ) \ln \left (\frac {-b x -a -1}{-a -1}\right )}{\left (a -1\right ) \left (a +1\right )}\right )\) | \(356\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 244, normalized size = 0.97 \begin {gather*} \frac {1}{4} \, b^{2} {\left (\frac {{\left (a - 1\right )} \log \left (b x + a + 1\right )^{2} - 2 \, {\left (a - 1\right )} \log \left (b x + a + 1\right ) \log \left (b x + a - 1\right ) + {\left (a + 1\right )} \log \left (b x + a - 1\right )^{2}}{a^{2} b - b} - \frac {4 \, {\left (\log \left (b x + a - 1\right ) \log \left (\frac {1}{2} \, b x + \frac {1}{2} \, a + \frac {1}{2}\right ) + {\rm Li}_2\left (-\frac {1}{2} \, b x - \frac {1}{2} \, a + \frac {1}{2}\right )\right )}}{a^{2} b - b} + \frac {4 \, {\left (\log \left (\frac {b x}{a + 1} + 1\right ) \log \left (x\right ) + {\rm Li}_2\left (-\frac {b x}{a + 1}\right )\right )}}{a^{2} b - b} - \frac {4 \, {\left (\log \left (\frac {b x}{a - 1} + 1\right ) \log \left (x\right ) + {\rm Li}_2\left (-\frac {b x}{a - 1}\right )\right )}}{a^{2} b - b}\right )} - b {\left (\frac {\log \left (b x + a + 1\right )}{a + 1} - \frac {\log \left (b x + a - 1\right )}{a - 1} + \frac {2 \, \log \left (x\right )}{a^{2} - 1}\right )} \operatorname {artanh}\left (b x + a\right ) - \frac {\operatorname {artanh}\left (b x + a\right )^{2}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {atanh}^{2}{\left (a + b x \right )}}{x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\mathrm {atanh}\left (a+b\,x\right )}^2}{x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________